home *** CD-ROM | disk | FTP | other *** search
/ Mission 3 / Mission 3.zip / Mission 3.iso / demovers / scripter / demo / uploader.sic < prev   
Text File  |  1998-09-26  |  1KB  |  73 lines

  1. /*
  2.  * Uploader-Statistik ueber die angegebene(n) Fileliste(n) erstellen
  3.  */
  4.  
  5. if (argc == 0) {
  6.     argv.length = 1;
  7.     argc = 1;
  8.     argv[0] = "";
  9.     if (fsel(argv[0], "Fileliste auswählen", "*.lst")==0)
  10.         exit(1);
  11. }
  12.  
  13. while (argc) {
  14.  
  15.     file = argv[--argc];
  16.     maus = "";
  17.     gpt = "";
  18.  
  19.     while (getline(file, line)) {                // Zeile einlesen
  20.         tok = split(line, " ");                         // im Worte zerlegen
  21.         c = line[0];
  22.         if (c >= '0' && c <= '9') {                     // Kopfzeile?
  23.             temp = tok[1];
  24.             if (temp == "ST") temp = "ST TOS";
  25.             systems[temp]++;            // Einträge/System
  26.             entries++;                // Einträge gesamt
  27.         }
  28.         else {
  29.             if (tok.length >= 4 && tok[0] == "Von"
  30.                 && tok[3] == "@") {
  31.                 temp = tok[1] + " " + tok[2];   // Uploader-Name
  32.                 uploader[temp]++;
  33.             }
  34.             else if (tok[0] == "Fileliste") {
  35.                 maus = line;
  36.             }
  37.             else if (tok[0] == "Gruppenprogrammteil") {
  38.                 gpt = line;
  39.             }
  40.         }
  41.     }
  42.  
  43.     printf("%s\n%s\n", maus, gpt);
  44.  
  45.     /*
  46.      * Liste: Archive pro Betriebsystem
  47.      */
  48.     with (i in systems) {
  49.         printf("%9s: %4d\n", i, systems[i]);
  50.     }
  51.     print("---------------");
  52.     printf("   Gesamt: %4d\n\n", entries);
  53.  
  54.     /*
  55.      * Liste: Alle Mauser, die mehr als 9 Archive hochgeladen haben
  56.      * (zweispaltig: <Name> <Anzahl Uploads>)
  57.      */
  58.     cnt = 0;
  59.     with (i in uploader) {
  60.         if (uploader[i] > 9) {
  61.             if (cnt == 0) {
  62.                 sprintf(temp, "%22s: %4d", i, uploader[i]);
  63.                 cnt = 1;
  64.             }
  65.             else {
  66.                 printf("%s   %22s: %4d\n", temp, i, uploader[i]);
  67.                 cnt = 0;
  68.             }
  69.         }
  70.     }
  71.     if (cnt) print(temp);
  72. }
  73.